//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "DGNeumaBC.h"

// MOOSE includes
#include "MooseVariableFE.h"

#include "libmesh/numeric_vector.h"
#include "libmesh/utility.h"

// C++ includes
#include <cmath>

registerMooseObject("snakeApp", DGNeumaBC);

template <>
InputParameters
validParams<DGNeumaBC>()
{
  InputParameters params = validParams<IntegratedBC>();
  params.addRequiredParam<Real>("therflux", "The value the var the boundary");

   return params;
}

DGNeumaBC::DGNeumaBC(const InputParameters & parameters)
  : IntegratedBC(parameters),
  _therflux(getParam<Real>("therflux"))
 {
}

Real
DGNeumaBC::computeQpResidual()
{
  const unsigned int elem_b_order = _var.order();
  const double h_elem =
      _current_elem->volume() / _current_side_elem->volume() * 1. / Utility::pow<2>(elem_b_order);

  Real r = 0;
  r += _therflux *_test[_i][_qp];
 
  return r;
}

Real
DGNeumaBC::computeQpJacobian()
{
   Real r = 0;
   //r += (_kappa * _grad_phi[_j][_qp] * _normals[_qp] * _test[_i][_qp]);
  return r;
}
